export default [
    {
      path: '/plant',
      name: 'Plant',
      meta: { title: '种植管理', icon: 'document' },
      hidden: false,
      redirect: '/plant/plan',
      children: [
        {
          path: 'plan',
          name: 'Plant-Plan-List',
          hidden: false,
          meta: { title: '种植计划', icon: 'Calendar', keepAlive: true },
          //component: () => import('@/view/plant/plan/index.vue'),
          redirect: '/plant/plan/list',
          children:[
            {
              path: 'list',
              name: 'Plant-Plan-List',
              hidden: true,
              meta: { title: '种植计划', icon: 'Calendar'},
              component: () => import('@/view/plant/plan/list.vue'),
            },
            {
              path: 'add',
              name: 'Plant-Plan-Add',
              hidden: true,
              meta: { title: '创建种植计划', icon: 'Calendar'},
              component: () => import('@/view/plant/plan/add.vue'),
              beforeEnter: (to, from, next) => {
                if(to.query.id){
                  to.meta.title = '编辑种植计划'
                }
                next()
              }
            },
            {
              path: 'detail',
              name: 'Plant-Plan-Detail',
              hidden: true,
              meta: { title: '种植计划详情', icon: 'Calendar'},
              component: () => import('@/view/plant/plan/detail.vue'),
            }
          ]
        },
        {
          path: 'task',
          name: 'Plant-Task-List',
          hidden: false,
          meta: { title: '农事任务', icon: 'Tickets' , keepAlive: true},
          //component: () => import('@/view/plant/task/index.vue'),
          redirect: '/plant/task/list',
          children:[
            {
              path: 'list',
              name: 'Plant-Task-List',
              hidden: true,
              meta: { title: '农事任务', icon: 'Calendar'},
              component: () => import('@/view/plant/task/list.vue'),
            },
            {
              path: 'edit',
              name: 'Plant-Task-edit',
              hidden: true,
              meta: { title: '修改种植农事', icon: 'Calendar'},
              component: () => import('@/view/plant/task/edit.vue'),
            }
          ]
        },
        {
          path: 'report',
          name: 'Plant-Report',
          hidden: false,
          meta: { title: '种植报告', icon: 'PieChart' , keepAlive: true},
          component: () => import('@/view/plant/report/index.vue'),
        }
      ]
    }
  ]
  